home *** CD-ROM | disk | FTP | other *** search
/ 9-Digit Zip Code Directory / 9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO / z4src.zip / CLTHREAD.HPP < prev    next >
C/C++ Source or Header  |  1993-09-02  |  3KB  |  89 lines

  1. //----------------------------------------------------------------------------
  2. //                            MODULE DESCRIPTION
  3. //
  4. //  Module:    clthread.hpp
  5. //   Title:    C++ Class Libraries
  6. //  Notice:    John M. Weeder
  7. //                 Copyright (c) 1993. All rights reserved.
  8. //             This module contains proprietary information and should be 
  9. //                treated as confidential.
  10. //
  11. //----------------------------------------------------------------------------
  12. //                           MAINTENANCE HISTORY
  13. //
  14. // $Workfile$
  15. // $Revision$
  16. //   $Author$
  17. //     $Date$
  18. //      $Log$    
  19. //
  20. //----------------------------------------------------------------------------
  21. //                             MODULE NARRATIVE
  22. //
  23. //    This module contains code for the class CL_THREAD.
  24. //
  25. //    The code in this module may be written in C++ or C.
  26. //
  27. //    This module is portable to:
  28. //        DOS 3.X+
  29. //        MS Windows 3.X+
  30. //        OS/2 2.X+
  31. //        OS/2 2.0 PM
  32. //
  33. //    The following compilers are supported:
  34. //        MSC 6.0A
  35. //        MSC/C++ 7.0
  36. //        Borland C++ 3.1 for DOS
  37. //        Borland C++ 1.0 for OS/2 2.X
  38. //
  39. //----------------------------------------------------------------------------
  40.  
  41. //----------------------------------------------------------------------------
  42. //    Class CL_THREAD
  43. //----------------------------------------------------------------------------
  44. CLASSDEF(CL_THREAD);
  45. #define CL_THREAD_PARENT CL_OBJECT
  46. class CLASSTYPE CL_THREAD : public CL_THREAD_PARENT
  47. {
  48.     TID tid;                                        // Thread id
  49.     BOOL fActive;                                // Active flag
  50.     CL_EVENT event;                            // Event semaphore
  51.  
  52. public:
  53.     FN_M CL_THREAD();
  54.     FN_M CL_THREAD(RCCL_THREAD);
  55.     virtual FN_M ~CL_THREAD();
  56.  
  57.     virtual BOOL FN_M Destroy(BOOL = TRUE);
  58.     virtual BOOL FN_M Initialize(SHORT = CL_INIT_ALL);
  59.     virtual BOOL FN_M IsActive() const
  60.         {
  61.         return fActive;
  62.         }
  63.     virtual BOOL FN_M IsError() const;
  64.     virtual BOOL FN_M IsValid() const;
  65.     RCCL_THREAD FN_M operator=(RCCL_THREAD);
  66.     virtual BOOL FN_M Retrieve(PCSZ, PCSZ = NULL);
  67.     BOOL FN_M Run();
  68.     virtual BOOL FN_M Store(PCSZ, PCSZ = NULL);
  69.     virtual VOID FN_M Thread() = 0;
  70.     TID FN_M Tid() const
  71.         {
  72.         return tid;
  73.         }
  74.     BOOL FN_M Wait(ULONG = -1);
  75.  
  76.  
  77. #if COMPILE_DEBUG
  78.     static VOID FN_M Print(PCCL_THREAD = NULL, PCSZ = NULL, SIZET = 0);
  79.     static BOOL FN_M Test(SHORT = 0);
  80. #endif
  81.  
  82. private:
  83.     static VOID FN_T ThreadFunc(PVOID);
  84. };
  85. //----------------------------------------------------------------------------
  86. //------------------------------- End of File --------------------------------
  87. //----------------------------------------------------------------------------
  88.  
  89.